package net.lzzy.practices.entities;

import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author m
 */
@Entity
@Setter
@Getter
public class Chapter extends  BaseEntity{
    private  String name;
    private  String  description;
    private  boolean open;
    @Temporal(TemporalType.TIMESTAMP)
    private Date createTime;
    @Temporal(TemporalType.TIMESTAMP)
    private Date updateTime;
    @ManyToOne
    private  Course course;
    @OneToMany(mappedBy = "chapter")
    private List<Question> questions=new ArrayList<>();
//    private List<TypePatternQuestions.Question> questions;
    public Chapter(){
        createTime = new Date();
        updateTime = new Date();
    }
}
